// app.js
//加载工具
import './utils/utils'
//http工具
import './utils/http'
App({
  onLaunch(){
    //获取本地存储的token
    this.getToken()
  },
  // 获取token
  getToken(){
    wx.getStorage({
      key:'token',
      success:({data})=>{
        this.token = data
      }
    })
    wx.getStorage({
      key:'refresh_token',
      success:({data})=>{
        this.refresh_token = data
      }
    })
  },
  // 存储token
  setToken(token,refresh_token){
    wx.setStorageSync('token', token)
    wx.setStorageSync('refresh_token', refresh_token)
    this.token = token
    this.refresh_token = refresh_token
  }
})
